package com.xdwanj.pojo;

public class Word implements Comparable<Word> {
    private int id;

    private String english;

    private String chinese;

    private String phoneticSymbol;

    public int getId() {
        return id;
    }

    public Word setId(int id) {
        this.id = id;
        return this;
    }

    public String getEnglish() {
        return english;
    }

    public Word setEnglish(String english) {
        this.english = english;
        return this;
    }

    public String getChinese() {
        return chinese;
    }

    public Word setChinese(String chinese) {
        this.chinese = chinese;
        return this;
    }

    public String getPhoneticSymbol() {
        return phoneticSymbol;
    }

    public Word setPhoneticSymbol(String phoneticSymbol) {
        this.phoneticSymbol = phoneticSymbol;
        return this;
    }


    @Override
    public String toString() {
        return "Word {" +
                "\n\tid = " + id +
                ",\n\tES = " + english +
                ",\n\tCS = " + chinese +
                ",\n\tPS = " + phoneticSymbol +
                "\n}\n";
    }

    @Override
    public int compareTo(Word o) {
        return Integer.compare(this.english.length(), o.getEnglish().length());
    }
}
